|
|
Hugo Elias has an interesting method to create spherical planetoids:
http://freespace.virgin.net/hugo.elias/models/m_landsp.htm
I tried to implement his method by recursively splitting an object (started
as a sphere) in random halves, and scaling one half slightly larger than the
other, then doing it over and over again. The method seems to work at low
iterations (<15), but when I went ahead and tried, say, 100 iterations, it
was taking *forever* to parse, and never did start rendering, my computer
locked on me, probably not enough memory. I'm interesting in implementing
this technique in POV-Ray, does anyone have any ideas to use less memory and
speed it up? I have included my source.
Or, does anyone have a better method to create planetoids such as these?
--
Paul Vanukoff
van### [at] primenetcom
// source follows //
#include "colors.inc"
#declare s1=seed(95937);
#declare Planetary=
sphere
{
< 0, 0, 0> 1
}
#declare K=0;
#while (K<15) // number of iterations
#declare rotX=360*rand(s1);
#declare rotY=360*rand(s1);
#declare rotZ=360*rand(s1);
#declare HalfOne=
intersection
{
box
{
<-1.2,0,-1.2>,<1.2,1.2,1.2>
rotate <rotX, rotY, rotZ>
}
object
{
Planetary
}
scale 1.001
}
#declare HalfTwo=
intersection
{
box
{
<-1.2,-1.2,-1.2>,<1.2,0,1.2>
rotate <rotX, rotY, rotZ>
}
object
{
Planetary
}
scale 0.999
}
#declare Planetary=
merge
{
object
{
HalfOne
}
object
{
HalfTwo
}
}
#declare K=K+1;
#end
camera
{
location < 0, 0, -3>
look_at < 0, 0, 0>
}
light_source
{
< 0, 9, -3>
color White
}
light_source
{
< 0, -9, 0>
color White/3
}
object
{
Planetary
pigment
{
color White
}
}
Post a reply to this message
|
|